package org.jmh.org.service.impl;

import org.jmh.auth.domain.Menu;
import org.jmh.auth.dto.RoleDTO;
import org.jmh.base.query.BaseQuery;
import org.jmh.base.service.impl.BaseServiceImpl;
import org.jmh.base.util.PageInfo;
import org.jmh.org.domain.Department;
import org.jmh.org.domain.Employee;
import org.jmh.org.mapper.EmployeeMapper;
import org.jmh.org.query.DepartmentQuery;
import org.jmh.org.query.EmployeeQuery;
import org.jmh.org.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {


    @Autowired
    private EmployeeMapper mapper;
    @Override
    public Employee selectByName(String username) {
        return mapper.selectByName(username);
    }

    @Override
    public List<Menu> getMenuByEmpId(Long id) {
        return mapper.getMenuByEmpId(id);
    }

    @Override
    public void auth1(RoleDTO roleDTO) {
        mapper.deleteAuth1(roleDTO.getId());
        mapper.auth1(roleDTO);
    }

    @Override
    public List<Long> queryRoleById(Long id) {
        return mapper.queryRoleById(id);
    }
}
